using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Runtime.InteropServices;

namespace WoW_Machinima_Studio.Network
{

	public enum ServerType
	{
		Realm = 1,
		World = 2
	}
	[StructLayout(LayoutKind.Sequential)]
	public struct PacketHeader
	{
		[MarshalAs(UnmanagedType.I2)]
		public short opcode;
		[MarshalAs(UnmanagedType.I2)]
		public short size;
	}
	public class Packet
	{
		#region Constants (Opcodes)
		
		public const short RS_LOGON_CHALLENGE = 0x0;
		public const short RS_LOGON_PROOF = 0x1;
		public const short RS_RECONNECT_CHALLENGE = 0x2;
		public const short RS_RECONNECT_PROOF = 0x3;
		public const short RS_UPDATESRV = 0x4;
		public const short RS_REALMLIST = 0x10;
		//RealmServer Error Codes
		public const short login_no_error = 0x0;
		public const short login_account_closed = 0x3;
		public const short login_bad_user = 0x4;
		public const short login_bad_pass = 0x5;
		public const short login_account_already_logged = 0x6;
		public const short login_prepaid_time_used_up = 0x7;
		public const short login_could_not_log_in_try_again_later = 0x8;
		public const short login_bad_client_version = 0x9;

		public const short CHAR_LIST_RETRIEVING = 0x2A;
		public const short CHAR_LIST_RETRIEVED = 0x2B;
		public const short CHAR_LIST_FAILED = 0x2C;

		public const short world_no_error = 0x2D;
		public const short world_error = 0x2E;
		public const short world_creation_failed = 0x2F;
		public const short world_name_unavailable = 0x30;
		public const short world_race_or_class_disabled = 0x31;
		public const short world_pvp_team = 0x32;
		public const short world_max_characters = 0x33;

		public const short CHAR_CREATE_CREATING_CHARACTER = 0x2D;
		public const short CHAR_CREATE_OK = 0x2E;
		public const short CHAR_CREATE_ERROR = 0x2F;
		public const short CHAR_CREATE_FAILED = 0x30;
		public const short CHAR_CREATE_NAME_IN_USE = 0x31;
		public const short CHAR_CREATE_RACE_CLASS_DISABLED = 0x32;
		public const short CHAR_CREATE_BOTH_HORDE_ALIANCE = 0x33;
		public const short CHAR_CREATE_MAX_CHARACTERS_ON_THIS_REALM = 0x34;
		public const short CHAR_CREATE_MAX_CHARACTERS_ON_THIS_ACCOUNT = 0x35;
		public const short CHAR_CREATE_CREATION_DISABLED = 0x36;
		public const short CHAR_CREATE_ONLY_EXISTING_CHARACTERS = 0x37;

		//World Server Opcodes
		public const short CMSG_ACCEPT_TRADE = 0x11A;
		public const short CMSG_ACTIVATETAXI = 0x1AD;
		public const short CMSG_ADD_FRIEND = 0x69;
		public const short CMSG_ADD_IGNORE = 0x6C;
		public const short CMSG_ADD_PVP_MEDAL_CHEAT = 0x289;
		public const short CMSG_ADVANCE_SPAWN_TIME = 0x31;
		public const short CMSG_AREATRIGGER = 180;
		public const short CMSG_ATTACKSTOP = 0x142;
		public const short CMSG_ATTACKSWING = 0x141;
		public const short CMSG_AUCTION_LIST_BIDDER_ITEMS = 0x264;
		public const short CMSG_AUCTION_LIST_ITEMS = 600;
		public const short CMSG_AUCTION_LIST_OWNER_ITEMS = 0x259;
		public const short CMSG_AUCTION_PLACE_BID = 0x25A;
		public const short CMSG_AUCTION_REMOVE_ITEM = 0x257;
		public const short CMSG_AUCTION_SELL_ITEM = 0x256;
		public const short CMSG_AUTH_SESSION = 0x1ED;
		public const short CMSG_AUTH_SRP6_BEGIN = 0x33;
		public const short CMSG_AUTH_SRP6_PROOF = 0x34;
		public const short CMSG_AUTH_SRP6_RECODE = 0x35;
		public const short CMSG_AUTOBANK_ITEM = 0x283;
		public const short CMSG_AUTOEQUIP_GROUND_ITEM = 0x106;
		public const short CMSG_AUTOEQUIP_ITEM = 0x10A;
		public const short CMSG_AUTOSTORE_BAG_ITEM = 0x10B;
		public const short CMSG_AUTOSTORE_BANK_ITEM = 0x282;
		public const short CMSG_AUTOSTORE_GROUND_ITEM = 0x107;
		public const short CMSG_AUTOSTORE_LOOT_ITEM = 0x108;
		public const short CMSG_BANKER_ACTIVATE = 0x1B7;
		public const short CMSG_BATTLEFIELD_JOIN = 0x23E;
		public const short CMSG_BATTLEFIELD_LIST = 0x23C;
		public const short CMSG_BATTLEFIELD_STATUS = 0x2D3;
		public const short CMSG_BEASTMASTER = 0x21;
		public const short CMSG_BEGIN_TRADE = 0x117;
		public const short CMSG_BINDER_ACTIVATE = 0x1B5;
		public const short CMSG_BOOTME = 1;
		public const short CMSG_BUG = 0x1CA;
		public const short CMSG_BUSY_TRADE = 280;
		public const short CMSG_BUY_BANK_SLOT = 0x1B9;
		public const short CMSG_BUY_ITEM = 0x1A2;
		public const short CMSG_BUY_ITEM_IN_SLOT = 0x1A3;
		public const short CMSG_BUY_STABLE_SLOT = 0x272;
		public const short CMSG_BUYBACK_ITEM = 0x290;
		public const short CMSG_CANCEL_AURA = 310;
		public const short CMSG_CANCEL_AUTO_REPEAT_SPELL = 0x26D;
		public const short CMSG_CANCEL_CAST = 0x12F;
		public const short CMSG_CANCEL_CHANNELLING = 0x13B;
		public const short CMSG_CANCEL_GROWTH_AURA = 0x29B;
		public const short CMSG_CANCEL_TRADE = 0x11C;
		public const short CMSG_CAST_SPELL = 0x12E;
		public const short CMSG_CHANNEL_ANNOUNCEMENTS = 0xA7;
		public const short CMSG_CHANNEL_BAN = 0xA5;
		public const short CMSG_CHANNEL_INVITE = 0xA3;
		public const short CMSG_CHANNEL_KICK = 0xA4;
		public const short CMSG_CHANNEL_LIST = 0x9A;
		public const short CMSG_CHANNEL_MODERATE = 0xA8;
		public const short CMSG_CHANNEL_MODERATOR = 0x9F;
		public const short CMSG_CHANNEL_MUTE = 0xA1;
		public const short CMSG_CHANNEL_OWNER = 0x9E;
		public const short CMSG_CHANNEL_PASSWORD = 0x9C;
		public const short CMSG_CHANNEL_SET_OWNER = 0x9D;
		public const short CMSG_CHANNEL_UNBAN = 0xA6;
		public const short CMSG_CHANNEL_UNMODERATOR = 160;
		public const short CMSG_CHANNEL_UNMUTE = 0xA2;
		public const short CMSG_CHAR_CREATE = 0x36;
		public const short CMSG_CHAR_DELETE = 0x38;
		public const short CMSG_CHAR_ENUM = 0x37;
		public const short CMSG_CHARACTER_POINT_CHEAT = 0x223;
		public const short CMSG_CHAT_IGNORED = 0x225;
		public const short CMSG_CHEAT_SETMONEY = 0x24;
		public const short CMSG_CLEAR_EXPLORATION = 0x237;
		public const short CMSG_CLEAR_QUEST = 0x2C;
		public const short CMSG_CLEAR_TRADE_ITEM = 0x11E;
		public const short CMSG_COMPLETE_CINEMATIC = 0xFC;
		public const short CMSG_COOLDOWN_CHEAT = 40;
		public const short CMSG_CREATEGAMEOBJECT = 20;
		public const short CMSG_CREATEITEM = 0x13;
		public const short CMSG_CREATEMONSTER = 0x11;
		public const short CMSG_CREATURE_QUERY = 0x60;
		public const short CMSG_DBLOOKUP = 2;
		public const short CMSG_DEBUG_AISTATE = 0x2E;
		public const short CMSG_DEBUG_CHANGECELLZONE = 12;
		public const short CMSG_DECHARGE = 0x204;
		public const short CMSG_DEL_FRIEND = 0x6A;
		public const short CMSG_DEL_IGNORE = 0x6D;
		public const short CMSG_DEL_PVP_MEDAL_CHEAT = 650;
		public const short CMSG_DESTROYITEM = 0x111;
		public const short CMSG_DESTROYMONSTER = 0x12;
		public const short CMSG_DISABLE_PVP_CHEAT = 0x30;
		public const short CMSG_DROP_ITEM = 0x110;
		public const short CMSG_DUEL_ACCEPTED = 0x16C;
		public const short CMSG_DUEL_CANCELLED = 0x16D;
		public const short CMSG_EMBLAZON_TABARD_OBSOLETE = 13;
		public const short CMSG_EMOTE = 0x102;
		public const short CMSG_ENABLE_DAMAGE_LOG = 0x27D;
		public const short CMSG_ENABLE_PVP = 0x253;
		public const short CMSG_ENABLEDEBUGCOMBATLOGGING_OBSOLETE = 0x17;
		public const short CMSG_FAR_SIGHT = 0x27A;
		public const short CMSG_FLAG_QUEST = 0x2A;
		public const short CMSG_FLAG_QUEST_FINISH = 0x2B;
		public const short CMSG_FORCE_MOVE_ROOT_ACK = 0xE9;
		public const short CMSG_FORCE_MOVE_UNROOT_ACK = 0xEB;
		public const short CMSG_FORCE_RUN_BACK_SPEED_CHANGE_ACK = 0xE5;
		public const short CMSG_FORCE_RUN_SPEED_CHANGE_ACK = 0xE3;
		public const short CMSG_FORCE_SWIM_SPEED_CHANGE_ACK = 0xE7;
		public const short CMSG_FORCEACTION = 0x18;
		public const short CMSG_FORCEACTIONONOTHER = 0x19;
		public const short CMSG_FORCEACTIONSHOW = 0x1A;
		public const short CMSG_FRIEND_LIST = 0x66;
		public const short CMSG_GAMEOBJ_CHAIR_USE_OBSOLETE = 0xB2;
		public const short CMSG_GAMEOBJ_USE = 0xB1;
		public const short CMSG_GAMEOBJECT_QUERY = 0x5E;
		public const short CMSG_GAMESPEED_SET = 70;
		public const short CMSG_GAMETIME_SET = 0x44;
		public const short CMSG_GET_MAIL_LIST = 570;
		public const short CMSG_GETDEATHBINDZONE = 0x156;
		public const short CMSG_GHOST = 0x1E5;
		public const short CMSG_GM_CREATE_ITEM_TARGET = 0x210;
		public const short CMSG_GM_FREEZE = 0x22D;
		public const short CMSG_GM_INVIS = 0x1E6;
		public const short CMSG_GM_MOVECORPSE = 0x22C;
		public const short CMSG_GM_NUKE = 0x1FA;
		public const short CMSG_GM_REQUEST_PLAYER_INFO = 0x22F;
		public const short CMSG_GM_RESURRECT = 0x22A;
		public const short CMSG_GM_REVEALTO = 0x229;
		public const short CMSG_GM_SET_SECURITY_GROUP = 0x1F9;
		public const short CMSG_GM_SILENCE = 0x228;
		public const short CMSG_GM_SUMMONMOB = 0x22B;
		public const short CMSG_GM_TEACH = 0x20F;
		public const short CMSG_GM_UBERINVIS = 0x22E;
		public const short CMSG_GM_VISION = 550;
		public const short CMSG_GMTICKET_CREATE = 0x205;
		public const short CMSG_GMTICKET_DELETETICKET = 0x217;
		public const short CMSG_GMTICKET_GETTICKET = 0x211;
		public const short CMSG_GMTICKET_SYSTEMSTATUS = 0x21A;
		public const short CMSG_GMTICKET_UPDATETEXT = 0x207;
		public const short CMSG_GMTICKETSYSTEM_TOGGLE = 0x29A;
		public const short CMSG_GODMODE = 0x22;
		public const short CMSG_GOSSIP_HELLO = 0x17B;
		public const short CMSG_GOSSIP_SELECT_OPTION = 380;
		public const short CMSG_GROUP_ACCEPT = 0x72;
		public const short CMSG_GROUP_ASSISTANT_LEADER = 0x28F;
		public const short CMSG_GROUP_CANCEL = 0x70;
		public const short CMSG_GROUP_CHANGE_SUB_GROUP = 0x27E;
		public const short CMSG_GROUP_DECLINE = 0x73;
		public const short CMSG_GROUP_DISBAND = 0x7B;
		public const short CMSG_GROUP_INVITE = 110;
		public const short CMSG_GROUP_RAID_CONVERT = 0x28E;
		public const short CMSG_GROUP_SET_LEADER = 120;
		public const short CMSG_GROUP_SWAP_SUB_GROUP = 640;
		public const short CMSG_GROUP_UNINVITE = 0x75;
		public const short CMSG_GROUP_UNINVITE_GUID = 0x76;
		public const short CMSG_GUILD_ACCEPT = 0x84;
		public const short CMSG_GUILD_ADD_RANK = 0x232;
		public const short CMSG_GUILD_CREATE = 0x81;
		public const short CMSG_GUILD_DECLINE = 0x85;
		public const short CMSG_GUILD_DEL_RANK = 0x233;
		public const short CMSG_GUILD_DEMOTE = 140;
		public const short CMSG_GUILD_DISBAND = 0x8F;
		public const short CMSG_GUILD_INFO = 0x87;
		public const short CMSG_GUILD_INVITE = 130;
		public const short CMSG_GUILD_LEADER = 0x90;
		public const short CMSG_GUILD_LEAVE = 0x8D;
		public const short CMSG_GUILD_MOTD = 0x91;
		public const short CMSG_GUILD_PROMOTE = 0x8B;
		public const short CMSG_GUILD_QUERY = 0x54;
		public const short CMSG_GUILD_RANK = 0x231;
		public const short CMSG_GUILD_REMOVE = 0x8E;
		public const short CMSG_GUILD_ROSTER = 0x89;
		public const short CMSG_GUILD_SET_OFFICER_NOTE = 0x235;
		public const short CMSG_GUILD_SET_PUBLIC_NOTE = 0x234;
		public const short CMSG_IGNORE_TRADE = 0x119;
		public const short CMSG_INITIATE_TRADE = 0x116;
		public const short CMSG_INSPECT = 0x114;
		public const short CMSG_ITEM_NAME_QUERY = 0x2C4;
		public const short CMSG_ITEM_QUERY_MULTIPLE = 0x57;
		public const short CMSG_ITEM_QUERY_SINGLE = 0x56;
		public const short CMSG_ITEM_TEXT_QUERY = 0x243;
		public const short CMSG_JOIN_CHANNEL = 0x97;
		public const short CMSG_LEARN_SPELL = 0x10;
		public const short CMSG_LEARN_TALENT = 0x251;
		public const short CMSG_LEAVE_CHANNEL = 0x98;
		public const short CMSG_LEVEL_CHEAT = 0x25;
		public const short CMSG_LEVELUP_CHEAT_OBSOLETE = 0x27;
		public const short CMSG_LIST_INVENTORY = 0x19E;
		public const short CMSG_LOGOUT_CANCEL = 0x4E;
		public const short CMSG_LOGOUT_REQUEST = 0x4B;
		public const short CMSG_LOOT = 0x15D;
		public const short CMSG_LOOT_MASTER_GIVE = 0x2A3;
		public const short CMSG_LOOT_METHOD = 0x7A;
		public const short CMSG_LOOT_MONEY = 350;
		public const short CMSG_LOOT_RELEASE = 0x15F;
		public const short CMSG_LOOT_ROLL = 0x2A0;
		public const short CMSG_MAIL_CREATE_TEXT_ITEM = 0x24A;
		public const short CMSG_MAIL_DELETE = 0x249;
		public const short CMSG_MAIL_MARK_AS_READ = 0x247;
		public const short CMSG_MAIL_RETURN_TO_SENDER = 0x248;
		public const short CMSG_MAIL_TAKE_ITEM = 0x246;
		public const short CMSG_MAIL_TAKE_MONEY = 0x245;
		public const short CMSG_MAKEMONSTERATTACKGUID = 0x16;
		public const short CMSG_MAKEMONSTERATTACKME = 0x15;
		public const short CMSG_MEETING_STONE_CHEAT = 660;
		public const short CMSG_MEETING_STONE_INFO = 0x296;
		public const short CMSG_MEETING_STONE_JOIN = 0x292;
		public const short CMSG_MEETING_STONE_LEAVE = 0x293;
		public const short CMSG_MESSAGECHAT = 0x95;
		public const short CMSG_MOUNTSPECIAL_ANIM = 0x171;
		public const short CMSG_MOVE_HOVER_ACK = 0xF6;
		public const short CMSG_MOVE_KNOCK_BACK_ACK = 240;
		public const short CMSG_MOVE_SET_RAW_POSITION = 0xE1;
		public const short CMSG_MOVE_TIME_SKIPPED = 0x2CE;
		public const short CMSG_NAME_QUERY = 80;
		public const short CMSG_NEW_SPELL_SLOT = 0x12D;
		public const short CMSG_NEXT_CINEMATIC_CAMERA = 0xFB;
		public const short CMSG_NPC_TEXT_QUERY = 0x17F;
		public const short CMSG_OFFER_PETITION = 0x1C3;
		public const short CMSG_OPEN_ITEM = 0xAC;
		public const short CMSG_OPENING_CINEMATIC = 0xF9;
		public const short CMSG_PAGE_TEXT_QUERY = 90;
		public const short CMSG_PET_ABANDON = 0x176;
		public const short CMSG_PET_ACTION = 0x175;
		public const short CMSG_PET_CANCEL_AURA = 0x26B;
		public const short CMSG_PET_CAST_SPELL_OBSOLETE = 0x17A;
		public const short CMSG_PET_LEVEL_CHEAT = 0x26;
		public const short CMSG_PET_NAME_QUERY = 0x52;
		public const short CMSG_PET_RENAME = 0x177;
		public const short CMSG_PET_SET_ACTION = 0x174;
		public const short CMSG_PETITION_BUY = 0x1BD;
		public const short CMSG_PETITION_QUERY = 0x1C6;
		public const short CMSG_PETITION_SHOW_SIGNATURES = 0x1BE;
		public const short CMSG_PETITION_SHOWLIST = 0x1BB;
		public const short CMSG_PETITION_SIGN = 0x1C0;
		public const short CMSG_PICKUP_ITEM = 0x10F;
		public const short CMSG_PING = 0x1DC;
		public const short CMSG_PLAYED_TIME = 460;
		public const short CMSG_PLAYER_AI_CHEAT = 620;
		public const short CMSG_PLAYER_LOGIN = 0x3D;
		public const short CMSG_PLAYER_LOGOUT = 0x4A;
		public const short CMSG_PLAYER_MACRO_OBSOLETE = 0x1E3;
		public const short CMSG_PUSHQUESTTOPARTY = 0x19D;
		public const short CMSG_PVP_PORT_OBSOLETE = 50;
		public const short CMSG_QUERY_OBJECT_POSITION = 4;
		public const short CMSG_QUERY_OBJECT_ROTATION = 6;
		public const short CMSG_QUERY_TIME = 0x1CE;
		public const short CMSG_QUEST_CONFIRM_ACCEPT = 0x19B;
		public const short CMSG_QUEST_QUERY = 0x5C;
		public const short CMSG_QUESTGIVER_ACCEPT_QUEST = 0x189;
		public const short CMSG_QUESTGIVER_CANCEL = 400;
		public const short CMSG_QUESTGIVER_CHOOSE_REWARD = 0x18E;
		public const short CMSG_QUESTGIVER_COMPLETE_QUEST = 0x18A;
		public const short CMSG_QUESTGIVER_HELLO = 0x184;
		public const short CMSG_QUESTGIVER_QUERY_QUEST = 390;
		public const short CMSG_QUESTGIVER_QUEST_AUTOLAUNCH = 0x187;
		public const short CMSG_QUESTGIVER_REQUEST_REWARD = 0x18C;
		public const short CMSG_QUESTGIVER_STATUS_QUERY = 0x182;
		public const short CMSG_QUESTLOG_REMOVE_QUEST = 0x194;
		public const short CMSG_QUESTLOG_SWAP_QUEST = 0x193;
		public const short CMSG_READ_ITEM = 0xAD;
		public const short CMSG_RECHARGE = 15;
		public const short CMSG_RECLAIM_CORPSE = 0x1D2;
		public const short CMSG_REPAIR_ITEM = 680;
		public const short CMSG_REPOP_REQUEST = 0x15A;
		public const short CMSG_REQUEST_ACCOUNT_DATA = 0x20A;
		public const short CMSG_REQUEST_PET_INFO = 0x279;
		public const short CMSG_REQUEST_RAID_INFO = 0x2CD;
		public const short CMSG_RESET_FACTION_CHEAT = 0x281;
		public const short CMSG_RESURRECT_RESPONSE = 0x15C;
		public const short CMSG_RUN_SCRIPT = 0x2B5;
		public const short CMSG_RWHOIS = 0x1FD;
		public const short CMSG_SAVE_PLAYER = 0x153;
		public const short CMSG_SCREENSHOT = 0x1E7;
		public const short CMSG_SELF_RES = 0x2B3;
		public const short CMSG_SELL_ITEM = 0x1A0;
		public const short CMSG_SEND_EVENT = 0x2D;
		public const short CMSG_SEND_MAIL = 0x238;
		public const short CMSG_SERVER_BROADCAST = 690;
		public const short CMSG_SERVER_COMMAND = 0x227;
		public const short CMSG_SERVERTIME = 0x48;
		public const short CMSG_SET_ACTION_BUTTON = 0x128;
		public const short CMSG_SET_ACTIONBAR_TOGGLES = 0x2BF;
		public const short CMSG_SET_ACTIVE_MOVER = 0x26A;
		public const short CMSG_SET_AMMO = 0x268;
		public const short CMSG_SET_DURABILITY_CHEAT = 0x287;
		public const short CMSG_SET_EXPLORATION = 0x2BE;
		public const short CMSG_SET_FACTION_ATWAR = 0x125;
		public const short CMSG_SET_FACTION_CHEAT = 0x126;
		public const short CMSG_SET_LOOKING_FOR_GROUP = 0x200;
		public const short CMSG_SET_PVP_RANK_CHEAT = 0x288;
		public const short CMSG_SET_PVP_TITLE = 0x28B;
		public const short CMSG_SET_SELECTION = 0x13D;
		public const short CMSG_SET_SKILL_CHEAT = 0x1D8;
		public const short CMSG_SET_STAT_CHEAT = 0x21D;
		public const short CMSG_SET_TARGET = 0x13E;
		public const short CMSG_SET_TRADE_GOLD = 0x11F;
		public const short CMSG_SET_TRADE_ITEM = 0x11D;
		public const short CMSG_SETDEATHBINDPOINT = 340;
		public const short CMSG_SETSHEATHED = 480;
		public const short CMSG_SHEATHE_OBSOLETE = 0x152;
		public const short CMSG_SKILL_BUY_RANK = 0x220;
		public const short CMSG_SKILL_BUY_STEP = 0x21F;
		public const short CMSG_SPIRIT_HEALER_ACTIVATE = 540;
		public const short CMSG_SPLIT_ITEM = 270;
		public const short CMSG_STABLE_PET = 0x270;
		public const short CMSG_STABLE_REVIVE_PET = 0x274;
		public const short CMSG_STABLE_SWAP_PET = 0x275;
		public const short CMSG_STANDSTATECHANGE = 0x101;
		public const short CMSG_STORE_LOOT_IN_SLOT = 0x109;
		public const short CMSG_SUMMON_RESPONSE = 0x2AC;
		public const short CMSG_SWAP_INV_ITEM = 0x10D;
		public const short CMSG_SWAP_ITEM = 0x10C;
		public const short CMSG_TAXICLEARALLNODES = 0x1A6;
		public const short CMSG_TAXICLEARNODE = 0x241;
		public const short CMSG_TAXIENABLEALLNODES = 0x1A7;
		public const short CMSG_TAXIENABLENODE = 0x242;
		public const short CMSG_TAXINODE_STATUS_QUERY = 0x1AA;
		public const short CMSG_TAXIQUERYAVAILABLENODES = 0x1AC;
		public const short CMSG_TAXISHOWNODES = 0x1A8;
		public const short CMSG_TELEPORT_TO_UNIT = 9;
		public const short CMSG_TEXT_EMOTE = 260;
		public const short CMSG_TOGGLE_CLOAK = 0x2BA;
		public const short CMSG_TOGGLE_HELM = 0x2B9;
		public const short CMSG_TRAINER_BUY_SPELL = 0x1B2;
		public const short CMSG_TRAINER_LIST = 0x1B0;
		public const short CMSG_TRIGGER_CINEMATIC_CHEAT = 0xF8;
		public const short CMSG_TURN_IN_PETITION = 0x1C4;
		public const short CMSG_TUTORIAL_CLEAR = 0xFF;
		public const short CMSG_TUTORIAL_FLAG = 0xFE;
		public const short CMSG_TUTORIAL_RESET = 0x100;
		public const short CMSG_UNACCEPT_TRADE = 0x11B;
		public const short CMSG_UNDRESSPLAYER = 0x20;
		public const short CMSG_UNEMBLAZON_TABARD_OBSOLETE = 14;
		public const short CMSG_UNLEARN_SKILL = 0x202;
		public const short CMSG_UNLEARN_SPELL = 0x201;
		public const short CMSG_UNLEARN_TALENTS = 0x213;
		public const short CMSG_UNSTABLE_PET = 0x271;
		public const short CMSG_UNUSED = 0x13F;
		public const short CMSG_UNUSED2 = 320;
		public const short CMSG_UPDATE_ACCOUNT_DATA = 0x20B;
		public const short CMSG_USE_ITEM = 0xAB;
		public const short CMSG_USE_SKILL_CHEAT = 0x29;
		public const short CMSG_WHO = 0x62;
		public const short CMSG_WHOIS = 100;
		public const short CMSG_WORLD_TELEPORT = 8;
		public const short CMSG_WRAP_ITEM = 0x1D3;
		public const short CMSG_XP_CHEAT = 0x221;
		public const short CMSG_ZONE_MAP = 10;
		public const short CMSG_ZONEUPDATE = 500;
		public const short MSG_ADD_DYNAMIC_TARGET = 0x1F0;
		public const short MSG_AUCTION_HELLO = 0x255;
		public const short MSG_CHANNEL_START = 0x139;
		public const short MSG_CHANNEL_UPDATE = 0x13A;
		public const short MSG_CORPSE_QUERY = 0x216;
		public const short MSG_GM_ACCOUNT_ONLINE = 0x26E;
		public const short MSG_GM_BIND_OTHER = 0x1E8;
		public const short MSG_GM_SHOWLABEL = 0x1EF;
		public const short MSG_GM_SUMMON = 0x1E9;
		public const short MSG_LIST_STABLED_PETS = 0x26F;
		public const short MSG_LOOKING_FOR_GROUP = 0x1FF;
		public const short MSG_MINIMAP_PING = 0x1D5;
		public const short MSG_MOVE_FALL_LAND = 0xC9;
		public const short MSG_MOVE_FEATHER_FALL = 0x2B0;
		public const short MSG_MOVE_HEARTBEAT = 0xEE;
		public const short MSG_MOVE_HOVER = 0xF7;
		public const short MSG_MOVE_JUMP = 0xBB;
		public const short MSG_MOVE_KNOCK_BACK = 0xF1;
		public const short MSG_MOVE_ROOT = 0xEC;
		public const short MSG_MOVE_SET_ALL_SPEED_CHEAT = 0xD6;
		public const short MSG_MOVE_SET_FACING = 0xDA;
		public const short MSG_MOVE_SET_PITCH = 0xDB;
		public const short MSG_MOVE_SET_RAW_POSITION_ACK = 0xE0;
		public const short MSG_MOVE_SET_RUN_BACK_SPEED = 0xCF;
		public const short MSG_MOVE_SET_RUN_BACK_SPEED_CHEAT = 0xCE;
		public const short MSG_MOVE_SET_RUN_MODE = 0xC2;
		public const short MSG_MOVE_SET_RUN_SPEED = 0xCD;
		public const short MSG_MOVE_SET_RUN_SPEED_CHEAT = 0xCC;
		public const short MSG_MOVE_SET_SWIM_BACK_SPEED = 0xD5;
		public const short MSG_MOVE_SET_SWIM_BACK_SPEED_CHEAT = 0xD4;
		public const short MSG_MOVE_SET_SWIM_SPEED = 0xD3;
		public const short MSG_MOVE_SET_SWIM_SPEED_CHEAT = 210;
		public const short MSG_MOVE_SET_TURN_RATE = 0xD8;
		public const short MSG_MOVE_SET_TURN_RATE_CHEAT = 0xD7;
		public const short MSG_MOVE_SET_WALK_MODE = 0xC3;
		public const short MSG_MOVE_SET_WALK_SPEED = 0xD1;
		public const short MSG_MOVE_SET_WALK_SPEED_CHEAT = 0xD0;
		public const short MSG_MOVE_START_BACKWARD = 0xB6;
		public const short MSG_MOVE_START_FORWARD = 0xB5;
		public const short MSG_MOVE_START_PITCH_DOWN = 0xC0;
		public const short MSG_MOVE_START_PITCH_UP = 0xBF;
		public const short MSG_MOVE_START_STRAFE_LEFT = 0xB8;
		public const short MSG_MOVE_START_STRAFE_RIGHT = 0xB9;
		public const short MSG_MOVE_START_SWIM = 0xCA;
		public const short MSG_MOVE_START_TURN_LEFT = 0xBC;
		public const short MSG_MOVE_START_TURN_RIGHT = 0xBD;
		public const short MSG_MOVE_STOP = 0xB7;
		public const short MSG_MOVE_STOP_PITCH = 0xC1;
		public const short MSG_MOVE_STOP_STRAFE = 0xBA;
		public const short MSG_MOVE_STOP_SWIM = 0xCB;
		public const short MSG_MOVE_STOP_TURN = 190;
		public const short MSG_MOVE_TELEPORT = 0xC5;
		public const short MSG_MOVE_TELEPORT_ACK = 0xC7;
		public const short MSG_MOVE_TELEPORT_CHEAT = 0xC6;
		public const short MSG_MOVE_TOGGLE_COLLISION_CHEAT = 0xD9;
		public const short MSG_MOVE_TOGGLE_FALL_LOGGING = 200;
		public const short MSG_MOVE_TOGGLE_GRAVITY_CHEAT = 0x2AD;
		public const short MSG_MOVE_TOGGLE_LOGGING = 0xC4;
		public const short MSG_MOVE_UNROOT = 0xED;
		public const short MSG_MOVE_WATER_WALK = 0x2B1;
		public const short MSG_MOVE_WORLDPORT_ACK = 220;
		public const short MSG_NULL_ACTION = 0;
		public const short MSG_PETITION_DECLINE = 450;
		public const short MSG_PETITION_RENAME = 0x2C1;
		public const short MSG_QUERY_NEXT_MAIL_TIME = 0x284;
		public const short MSG_QUEST_PUSH_RESULT = 630;
		public const short MSG_RANDOM_ROLL = 0x1FB;
		public const short MSG_SAVE_GUILD_EMBLEM = 0x1F1;
		public const short MSG_SPLIT_MONEY = 0x1D1;
		public const short MSG_TABARDVENDOR_ACTIVATE = 0x1F2;
		public const short MSG_TALENT_WIPE_CONFIRM = 0x2AA;
		public const short SMSG_ACCOUNT_DATA_MD5 = 0x209;
		public const short SMSG_ACTION_BUTTONS = 0x129;
		public const short SMSG_ACTIVATETAXIREPLY = 430;
		public const short SMSG_ADDON_INFO = 753 - 2;
		public const short SMSG_AI_REACTION = 0x13C;
		public const short SMSG_AREA_TRIGGER_MESSAGE = 0x2B8;
		public const short SMSG_ATTACKERSTATEUPDATE = 330;
		public const short SMSG_ATTACKERSTATEUPDATEDEBUGINFO_OBSOLETE = 0x1C;
		public const short SMSG_ATTACKSTART = 0x143;
		public const short SMSG_ATTACKSTOP = 0x144;
		public const short SMSG_ATTACKSWING_BADFACING = 0x146;
		public const short SMSG_ATTACKSWING_CANT_ATTACK = 0x149;
		public const short SMSG_ATTACKSWING_DEADTARGET = 0x148;
		public const short SMSG_ATTACKSWING_NOTINRANGE = 0x145;
		public const short SMSG_ATTACKSWING_NOTSTANDING = 0x147;
		public const short SMSG_AUCTION_BIDDER_LIST_RESULT = 0x265;
		public const short SMSG_AUCTION_BIDDER_NOTIFICATION = 0x25E;
		public const short SMSG_AUCTION_COMMAND_RESULT = 0x25B;
		public const short SMSG_AUCTION_LIST_RESULT = 0x25C;
		public const short SMSG_AUCTION_OWNER_LIST_RESULT = 0x25D;
		public const short SMSG_AUCTION_OWNER_NOTIFICATION = 0x25F;
		public const short SMSG_AUCTION_REMOVED_NOTIFICATION = 0x28D;
		public const short SMSG_AUTH_CHALLENGE = 0x1EC;
		public const short SMSG_AUTH_RESPONSE = 0x1EE;
		public const short SMSG_AUTH_RESPONSE2_UNKNOWN180 = 0x2F1;
		public const short SMSG_AUTH_SRP6_RESPONSE = 0x39;
		public const short SMSG_BATTLEFIELD_LIST = 0x23D;
		public const short SMSG_BATTLEFIELD_LOSE = 0x240;
		public const short SMSG_BATTLEFIELD_WIN = 0x23F;
		public const short SMSG_BINDPOINTUPDATE = 0x155;
		public const short SMSG_BINDZONEREPLY = 0x157;
		public const short SMSG_BUY_BANK_SLOT_RESULT = 0x1BA;
		public const short SMSG_BUY_FAILED = 0x1A5;
		public const short SMSG_BUY_ITEM = 420;
		public const short SMSG_CANCEL_AUTO_REPEAT = 0x29C;
		public const short SMSG_CANCEL_COMBAT = 0x14E;
		public const short SMSG_CAST_RESULT = 0x130;
		public const short SMSG_CHANNEL_LIST = 0x9B;
		public const short SMSG_CHANNEL_NOTIFY = 0x99;
		public const short SMSG_CHAR_CREATE = 0x3A;
		public const short SMSG_CHAR_DELETE = 60;
		public const short SMSG_CHAR_ENUM = 0x3B;
		public const short SMSG_CHARACTER_LOGIN_FAILED = 0x41;
		public const short SMSG_CHAT_PLAYER_NOT_FOUND = 0x2A9;
		public const short SMSG_CHAT_WRONG_FACTION = 0x219;
		public const short SMSG_CLEAR_COOLDOWN = 0x1DE;
		public const short SMSG_CLEAR_FAR_SIGHT_IMMEDIATE = 0x20D;
		public const short SMSG_COMPRESSED_UPDATE_OBJECT = 0x1F6;
		public const short SMSG_COOLDOWN_CHEAT = 0x1E1;
		public const short SMSG_COOLDOWN_EVENT = 0x135;
		public const short SMSG_CORPSE_RECLAIM_DELAY = 0x269;
		public const short SMSG_CREATURE_QUERY_RESPONSE = 0x61;
		public const short SMSG_DAMAGE_CALC_LOG = 0x27C;
		public const short SMSG_DAMAGE_DONE_OBSOLETE = 0x14C;
		public const short SMSG_DAMAGE_TAKEN_OBSOLETE = 0x14D;
		public const short SMSG_DBLOOKUP = 3;
		public const short SMSG_DEATH_NOTIFY_OBSOLETE = 0x159;
		public const short SMSG_DEBUG_AISTATE = 0x2F;
		public const short SMSG_DEBUG_PLAYER_RANGE_OBSOLETE = 0x1F;
		public const short SMSG_DEBUGAURAPROC = 0x24D;
		public const short SMSG_DEBUGINFOSPELL_OBSOLETE = 0x1D;
		public const short SMSG_DEBUGINFOSPELLMISS_OBSOLETE = 30;
		public const short SMSG_DESTROY_OBJECT = 170;
		public const short SMSG_DISMOUNTRESULT = 0x16F;
		public const short SMSG_DISPEL_FAILED = 610;
		public const short SMSG_DUEL_COMPLETE = 0x16A;
		public const short SMSG_DUEL_COUNTDOWN = 0x2B7;
		public const short SMSG_DUEL_INBOUNDS = 0x169;
		public const short SMSG_DUEL_OUTOFBOUNDS = 360;
		public const short SMSG_DUEL_REQUESTED = 0x167;
		public const short SMSG_DUEL_WINNER = 0x16B;
		public const short SMSG_DURABILITY_DAMAGE_DEATH = 0x2BD;
		public const short SMSG_EMOTE = 0x103;
		public const short SMSG_ENCHANTMENTLOG = 0x1D7;
		public const short SMSG_ENVIRONMENTALDAMAGELOG = 0x1FC;
		public const short SMSG_EXPLORATION_EXPERIENCE = 0x1F8;
		public const short SMSG_FEIGN_DEATH_RESISTED = 0x2B4;
		public const short SMSG_FISH_ESCAPED = 0x1C9;
		public const short SMSG_FISH_NOT_HOOKED = 0x1C8;
		public const short SMSG_FORCE_MOVE_ROOT = 0xE8;
		public const short SMSG_FORCE_MOVE_UNROOT = 0xEA;
		public const short SMSG_FORCE_RUN_BACK_SPEED_CHANGE = 0xE4;
		public const short SMSG_FORCE_RUN_SPEED_CHANGE = 0xE2;
		public const short SMSG_FORCE_SWIM_SPEED_CHANGE = 230;
		public const short SMSG_FORCEACTIONSHOW = 0x1B;
		public const short SMSG_FRIEND_LIST = 0x67;
		public const short SMSG_FRIEND_STATUS = 0x68;
		public const short SMSG_GAMEOBJECT_CUSTOM_ANIM = 0xB3;
		public const short SMSG_GAMEOBJECT_DESPAWN_ANIM = 0x215;
		public const short SMSG_GAMEOBJECT_PAGETEXT = 0x1DF;
		public const short SMSG_GAMEOBJECT_QUERY_RESPONSE = 0x5F;
		public const short SMSG_GAMEOBJECT_RESET_STATE = 0x2A7;
		public const short SMSG_GAMEOBJECT_SPAWN_ANIM = 0x214;
		public const short SMSG_GAMESPEED_SET = 0x47;
		public const short SMSG_GAMETIME_SET = 0x45;
		public const short SMSG_GAMETIME_UPDATE = 0x43;
		public const short SMSG_GM_PLAYER_INFO = 560;
		public const short SMSG_GMTICKET_CREATE = 0x206;
		public const short SMSG_GMTICKET_DELETETICKET = 0x218;
		public const short SMSG_GMTICKET_GETTICKET = 530;
		public const short SMSG_GMTICKET_SYSTEMSTATUS = 0x21B;
		public const short SMSG_GMTICKET_UPDATETEXT = 520;
		public const short SMSG_GODMODE = 0x23;
		public const short SMSG_GOSSIP_COMPLETE = 0x17E;
		public const short SMSG_GOSSIP_MESSAGE = 0x17D;
		public const short SMSG_GOSSIP_POI = 0x224;
		public const short SMSG_GROUP_CANCEL = 0x71;
		public const short SMSG_GROUP_DECLINE = 0x74;
		public const short SMSG_GROUP_DESTROYED = 0x7C;
		public const short SMSG_GROUP_INVITE = 0x6F;
		public const short SMSG_GROUP_LIST = 0x7D;
		public const short SMSG_GROUP_SET_LEADER = 0x79;
		public const short SMSG_GROUP_UNINVITE = 0x77;
		public const short SMSG_GUILD_COMMAND_RESULT = 0x93;
		public const short SMSG_GUILD_DECLINE = 0x86;
		public const short SMSG_GUILD_EVENT = 0x92;
		public const short SMSG_GUILD_INFO = 0x88;
		public const short SMSG_GUILD_INVITE = 0x83;
		public const short SMSG_GUILD_QUERY_RESPONSE = 0x55;
		public const short SMSG_GUILD_ROSTER = 0x8A;
		public const short SMSG_HEALSPELL_ON_PLAYER_OBSOLETE = 0x150;
		public const short SMSG_HEALSPELL_ON_PLAYERS_PET_OBSOLETE = 0x151;
		public const short SMSG_IGNORE_LIST = 0x6B;
		public const short SMSG_INIT_WORLD_STATES = 0x2C2;
		public const short SMSG_INITIAL_SPELLS = 0x12A;
		public const short SMSG_INITIALIZE_FACTIONS = 290;
		public const short SMSG_INSPECT = 0x115;
		public const short SMSG_INVENTORY_CHANGE_FAILURE = 0x112;
		public const short SMSG_ITEM_COOLDOWN = 0xB0;
		public const short SMSG_ITEM_ENCHANT_TIME_UPDATE = 0x1EB;
		public const short SMSG_ITEM_NAME_QUERY_RESPONSE = 0x2C5;
		public const short SMSG_ITEM_PUSH_RESULT = 0x166;
		public const short SMSG_ITEM_QUERY_MULTIPLE_RESPONSE = 0x59;
		public const short SMSG_ITEM_QUERY_SINGLE_RESPONSE = 0x58;
		public const short SMSG_ITEM_TEXT_QUERY_RESPONSE = 580;
		public const short SMSG_ITEM_TIME_UPDATE = 490;
		public const short SMSG_LEARNED_SPELL = 0x12B;
		public const short SMSG_LEVELUP_INFO = 0x1D4;
		public const short SMSG_LIST_INVENTORY = 0x19F;
		public const short SMSG_LOG_XPGAIN = 0x1D0;
		public const short SMSG_LOGIN_SETTIMESPEED = 0x42;
		public const short SMSG_LOGIN_VERIFY_WORLD = 0x236;
		public const short SMSG_LOGOUT_CANCEL_ACK = 0x4F;
		public const short SMSG_LOGOUT_COMPLETE = 0x4D;
		public const short SMSG_LOGOUT_RESPONSE = 0x4C;
		public const short SMSG_LOOT_ALL_PASSED = 670;
		public const short SMSG_LOOT_CLEAR_MONEY = 0x165;
		public const short SMSG_LOOT_ITEM_NOTIFY = 0x164;
		public const short SMSG_LOOT_MASTER_LIST = 0x2A4;
		public const short SMSG_LOOT_MONEY_NOTIFY = 0x163;
		public const short SMSG_LOOT_RELEASE_RESPONSE = 0x161;
		public const short SMSG_LOOT_REMOVED = 0x162;
		public const short SMSG_LOOT_RESPONSE = 0x160;
		public const short SMSG_LOOT_ROLL = 0x2A2;
		public const short SMSG_LOOT_ROLL_WON = 0x29F;
		public const short SMSG_LOOT_START_ROLL = 0x2A1;
		public const short SMSG_MAIL_LIST_RESULT = 0x23B;
		public const short SMSG_MEETING_STONE_COMPLETE = 0x297;
		public const short SMSG_MEETING_STONE_IN_PROGRESS = 0x298;
		public const short SMSG_MEETING_STONE_INFO = 0x295;
		public const short SMSG_MEETING_STONE_MEMBER_ADDED = 0x299;
		public const short SMSG_MESSAGECHAT = 150;
		public const short SMSG_MONSTER_MOVE = 0xDD;
		public const short SMSG_MONSTER_MOVE_TRANSPORT = 0x2AE;
		public const short SMSG_MOUNTRESULT = 0x16E;
		public const short SMSG_MOUNTSPECIAL_ANIM = 370;
		public const short SMSG_MOVE_FEATHER_FALL = 0xF2;
		public const short SMSG_MOVE_KNOCK_BACK = 0xEF;
		public const short SMSG_MOVE_LAND_WALK = 0xDF;
		public const short SMSG_MOVE_NORMAL_FALL = 0xF3;
		public const short SMSG_MOVE_SET_HOVER = 0xF4;
		public const short SMSG_MOVE_UNSET_HOVER = 0xF5;
		public const short SMSG_MOVE_WATER_WALK = 0xDE;
		public const short SMSG_NAME_QUERY_RESPONSE = 0x51;
		public const short SMSG_NEW_TAXI_PATH = 0x1AF;
		public const short SMSG_NEW_WORLD = 0x3E;
		public const short SMSG_NOTIFICATION = 0x1CB;
		public const short SMSG_NPC_TEXT_UPDATE = 0x180;
		public const short SMSG_NPC_WONT_TALK = 0x181;
		public const short SMSG_OBSOLETE = 0x1F7;
		public const short SMSG_OPEN_CONTAINER = 0x113;
		public const short SMSG_PAGE_TEXT_QUERY_RESPONSE = 0x5B;
		public const short SMSG_PARTY_COMMAND_RESULT = 0x7F;
		public const short SMSG_PARTY_MEMBER_STATS = 0x7E;
		public const short SMSG_PARTYKILLLOG = 0x1F5;
		public const short SMSG_PAUSE_MIRROR_TIMER = 0x1DA;
		public const short SMSG_PERIODICAURALOG = 590;
		public const short SMSG_PET_ACTION_FEEDBACK = 710;
		public const short SMSG_PET_BROKEN = 0x2AF;
		public const short SMSG_PET_CAST_FAILED = 0x138;
		public const short SMSG_PET_NAME_INVALID = 0x178;
		public const short SMSG_PET_NAME_QUERY_RESPONSE = 0x53;
		public const short SMSG_PET_SPELLS = 0x179;
		public const short SMSG_PET_TAME_FAILURE = 0x173;
		public const short SMSG_PETITION_QUERY_RESPONSE = 0x1C7;
		public const short SMSG_PETITION_SHOW_SIGNATURES = 0x1BF;
		public const short SMSG_PETITION_SHOWLIST = 0x1BC;
		public const short SMSG_PETITION_SIGN_RESULTS = 0x1C1;
		public const short SMSG_PLAY_MUSIC = 0x277;
		public const short SMSG_PLAY_OBJECT_SOUND = 0x278;
		public const short SMSG_PLAY_SPELL_VISUAL = 0x1F3;
		public const short SMSG_PLAYED_TIME = 0x1CD;
		public const short SMSG_PLAYER_COMBAT_XP_GAIN_OBSOLETE = 0x14F;
		public const short SMSG_PLAYER_MACRO_OBSOLETE = 0x1E4;
		public const short SMSG_PLAYER_SKINNED = 700;
		public const short SMSG_PLAYERBINDERROR = 0x1B6;
		public const short SMSG_PLAYERBOUND = 0x158;
		public const short SMSG_PONG = 0x1DD;
		public const short SMSG_POWERGAINLOG_OBSOLETE = 0x20E;
		public const short SMSG_PROCRESIST = 0x260;
		public const short SMSG_PUREMOUNT_CANCELLED_OBSOLETE = 0x170;
		public const short SMSG_PVP_CREDIT = 0x28C;
		public const short SMSG_QUERY_OBJECT_POSITION = 5;
		public const short SMSG_QUERY_OBJECT_ROTATION = 7;
		public const short SMSG_QUERY_TIME_RESPONSE = 0x1CF;
		public const short SMSG_QUEST_CONFIRM_ACCEPT = 0x19C;
		public const short SMSG_QUEST_QUERY_RESPONSE = 0x5D;
		public const short SMSG_QUESTGIVER_OFFER_REWARD = 0x18D;
		public const short SMSG_QUESTGIVER_QUEST_COMPLETE = 0x191;
		public const short SMSG_QUESTGIVER_QUEST_DETAILS = 0x188;
		public const short SMSG_QUESTGIVER_QUEST_FAILED = 0x192;
		public const short SMSG_QUESTGIVER_QUEST_INVALID = 0x18F;
		public const short SMSG_QUESTGIVER_QUEST_LIST = 0x185;
		public const short SMSG_QUESTGIVER_REQUEST_ITEMS = 0x18B;
		public const short SMSG_QUESTGIVER_STATUS = 0x183;
		public const short SMSG_QUESTLOG_FULL = 0x195;
		public const short SMSG_QUESTUPDATE_ADD_ITEM = 410;
		public const short SMSG_QUESTUPDATE_ADD_KILL = 0x199;
		public const short SMSG_QUESTUPDATE_COMPLETE = 0x198;
		public const short SMSG_QUESTUPDATE_FAILED = 0x196;
		public const short SMSG_QUESTUPDATE_FAILEDTIMER = 0x197;
		public const short SMSG_RAID_GROUP_ONLY = 0x286;
		public const short SMSG_RAID_INSTANCE_INFO = 0x2CC;
		public const short SMSG_RAID_MEMBER_STATS = 0x27F;
		public const short SMSG_READ_ITEM_FAILED = 0xAF;
		public const short SMSG_READ_ITEM_OK = 0xAE;
		public const short SMSG_RECEIVED_MAIL = 0x285;
		public const short SMSG_REMOVED_SPELL = 0x203;
		public const short SMSG_RESISTLOG = 470;
		public const short SMSG_RESURRECT_FAILED = 0x252;
		public const short SMSG_RESURRECT_REQUEST = 0x15B;
		public const short SMSG_RWHOIS = 510;
		public const short SMSG_SCRIPT_MESSAGE = 0x2B6;
		public const short SMSG_SELL_ITEM = 0x1A1;
		public const short SMSG_SEND_MAIL_RESULT = 0x239;
		public const short SMSG_SERVER_MESSAGE = 0x291;
		public const short SMSG_SERVERTIME = 0x49;
		public const short SMSG_SET_FACTION_STANDING = 0x124;
		public const short SMSG_SET_FACTION_VISIBLE = 0x123;
		public const short SMSG_SET_FLAT_SPELL_MODIFIER = 0x266;
		public const short SMSG_SET_FORCED_REACTIONS = 0x2A5;
		public const short SMSG_SET_PCT_SPELL_MODIFIER = 0x267;
		public const short SMSG_SET_PROFICIENCY = 0x127;
		public const short SMSG_SET_REST_START = 0x21E;
		public const short SMSG_SHOW_BANK = 440;
		public const short SMSG_SHOWTAXINODES = 0x1A9;
		public const short SMSG_SPELL_COOLDOWN = 0x134;
		public const short SMSG_SPELL_DELAYED = 0x1E2;
		public const short SMSG_SPELL_FAILED_OTHER = 0x2A6;
		public const short SMSG_SPELL_FAILURE = 0x133;
		public const short SMSG_SPELL_GO = 0x132;
		public const short SMSG_SPELL_REFLECTED = 0x2BB;
		public const short SMSG_SPELL_START = 0x131;
		public const short SMSG_SPELLDAMAGESHIELD = 0x24F;
		public const short SMSG_SPELLDISPELLOG = 0x27B;
		public const short SMSG_SPELLLOGEXECUTE = 0x24C;
		public const short SMSG_SPELLLOGMISS = 0x24B;
		public const short SMSG_SPELLNONMELEEDAMAGELOG = 0x250;
		public const short SMSG_SPELLORDAMAGE_IMMUNE = 0x263;
		public const short SMSG_SPIRIT_HEALER_CONFIRM = 0x222;
		public const short SMSG_STABLE_RESULT = 0x273;
		public const short SMSG_STANDSTATE_CHANGE_ACK = 0x29D;
		public const short SMSG_STANDSTATE_CHANGE_FAILURE = 0x261;
		public const short SMSG_START_MIRROR_TIMER = 0x1D9;
		public const short SMSG_STOP_MIRROR_TIMER = 0x1DB;
		public const short SMSG_SUMMON_REQUEST = 0x2AB;
		public const short SMSG_SUPERCEDED_SPELL = 300;
		public const short SMSG_TAXINODE_STATUS = 0x1AB;
		public const short SMSG_TEXT_EMOTE = 0x105;
		public const short SMSG_TRADE_STATUS = 0x120;
		public const short SMSG_TRADE_STATUS_EXTENDED = 0x121;
		public const short SMSG_TRAINER_BUY_FAILED = 0x1B4;
		public const short SMSG_TRAINER_BUY_SUCCEEDED = 0x1B3;
		public const short SMSG_TRAINER_LIST = 0x1B1;
		public const short SMSG_TRANSFER_ABORTED = 0x40;
		public const short SMSG_TRANSFER_PENDING = 0x3F;
		public const short SMSG_TRIGGER_CINEMATIC = 250;
		public const short SMSG_TURN_IN_PETITION_RESULTS = 0x1C5;
		public const short SMSG_TUTORIAL_FLAGS = 0xFD;
		public const short SMSG_UPDATE_ACCOUNT_DATA = 0x20C;
		public const short SMSG_UPDATE_AURA_DURATION = 0x137;
		public const short SMSG_UPDATE_OBJECT = 0xA9;
		public const short SMSG_UPDATE_WORLD_STATE = 0x2C3;
		public const short SMSG_VICTIMSTATEUPDATE_OBSOLETE = 0x14B;
		public const short SMSG_WHO = 0x63;
		public const short SMSG_WHOIS = 0x65;
		public const short SMSG_ZONE_MAP = 11;
		public const short SMSG_ZONE_UNDER_ATTACK = 0x254;
		public const short UMSG_DELETE_GUILD_CHARTER = 0x2C0;
		public const short UMSG_UPDATE_GROUP_MEMBERS = 0x80;
		public const short UMSG_UPDATE_GUILD = 0x94;

		public const short NUM_MSG_TYPES = 0x2AF;

		public const short CHAT_MSG_SAY = 0x0;
		public const short CHAT_MSG_PARTY = 0x1;
		public const short CHAT_MSG_GUILD = 0x2;
		public const short CHAT_MSG_OFFICER = 0x3;
		public const short CHAT_MSG_YELL = 0x4;
		public const short CHAT_MSG_WHISPER = 0x5;
		public const short CHAT_MSG_WHISPER_INFORM = 0x6;
		public const short CHAT_MSG_EMOTE = 0x7;
		public const short CHAT_MSG_TEXT_EMOTE = 0x8;
		public const short CHAT_MSG_SYSTEM = 0x9;
		public const short CHAT_MSG_MONSTER_SAY = 0xA;
		public const short CHAT_MSG_MONSTER_YELL = 0xB;
		public const short CHAT_MSG_MONSTER_EMOTE = 0xC;
		public const short CHAT_MSG_CHANNEL = 0xD;
		public const short CHAT_MSG_CHANNEL_JOIN = 0xE;
		public const short CHAT_MSG_CHANNEL_LEAVE = 0xF;
		public const short CHAT_MSG_CHANNEL_LIST = 0x10;
		public const short CHAT_MSG_CHANNEL_NOTICE = 0x11;
		public const short CHAT_MSG_CHANNEL_NOTICE_USER = 0x12;
		public const short CHAT_MSG_AFK = 0x13;
		public const short CHAT_MSG_DND = 0x14;
		public const short CHAT_MSG_COMBAT_LOG = 0x15;
		public const short CHAT_MSG_IGNORED = 0x16;
		public const short CHAT_MSG_SKILL = 0x17;
		public const short CHAT_MSG_LOOT = 0x18;


		public const short FRIEND_DB_ERROR = 0x0;
		public const short FRIEND_LIST_FULL = 0x1;
		public const short FRIEND_ONLINE = 0x2;
		public const short FRIEND_OFFLINE = 0x3;
		public const short FRIEND_NOT_FOUND = 0x4;
		public const short FRIEND_REMOVED = 0x5;
		public const short FRIEND_ADDED_ONLINE = 0x6;
		public const short FRIEND_ADDED_OFFLINE = 0x7;
		public const short FRIEND_ALREADY = 0x8;
		public const short FRIEND_SELF = 0x9;
		public const short FRIEND_ENEMY = 0xA;
		public const short FRIEND_IGNORE_FULL = 0xB;
		public const short FRIEND_IGNORE_SELF = 0xC;
		public const short FRIEND_IGNORE_NOT_FOUND = 0xD;
		public const short FRIEND_IGNORE_ALREADY = 0xE;
		public const short FRIEND_IGNORE_ADDED = 0xF;
		public const short FRIEND_IGNORE_REMOVED = 0x10;


		public const short EQUIPMENT_SLOT_START = 0;
		public const short EQUIPMENT_SLOT_HEAD = 0;
		public const short EQUIPMENT_SLOT_NECK = 1;
		public const short EQUIPMENT_SLOT_SHOULDERS = 2;
		public const short EQUIPMENT_SLOT_BODY = 3;
		public const short EQUIPMENT_SLOT_CHEST = 4;
		public const short EQUIPMENT_SLOT_WAIST = 5;
		public const short EQUIPMENT_SLOT_LEGS = 6;
		public const short EQUIPMENT_SLOT_FEET = 7;
		public const short EQUIPMENT_SLOT_WRISTS = 8;
		public const short EQUIPMENT_SLOT_HANDS = 9;
		public const short EQUIPMENT_SLOT_FINGER1 = 10;
		public const short EQUIPMENT_SLOT_FINGER2 = 11;
		public const short EQUIPMENT_SLOT_TRINKET1 = 12;
		public const short EQUIPMENT_SLOT_TRINKET2 = 13;
		public const short EQUIPMENT_SLOT_BACK = 14;
		public const short EQUIPMENT_SLOT_MAINHAND = 15;
		public const short EQUIPMENT_SLOT_OFFHAND = 16;
		public const short EQUIPMENT_SLOT_RANGED = 17;
		public const short EQUIPMENT_SLOT_TABARD = 18;
		#endregion
		//TODO Packet class implemention
		private PacketHeader _header;
		private List<Object> _data;
		public List<Object> Data
		{
			get { return _data; }
		}
		public PacketHeader Header
		{
			get { return _header; }
		}
		public static Packet FromStream(Stream stream)
		{
			Packet p = new Packet();
			p._header = Helper.StreamToStruct<PacketHeader>(stream);
			if ((p._header.opcode == 0) || (p._header.size == 0))
				throw new EndOfStreamException();
			BinaryReader reader = new BinaryReader(stream);
			switch (p._header.opcode)
			{
				case RS_RECONNECT_CHALLENGE:
				case RS_LOGON_CHALLENGE:
					//Version
					p._data.Add(reader.ReadByte() + "." + reader.ReadByte() + "." + reader.ReadByte());
					//Build number
					p._data.Add(reader.ReadInt16());
					//IP Number
					p._data.Add(reader.ReadByte() + "." + reader.ReadByte() + "." + reader.ReadByte() + reader.ReadByte());
					//
					p._data.Add(reader.ReadString());
					break;
				case CMSG_AUTH_SESSION:
					break;
			}

			return p;
		}
		public Packet()
		{
			_data = new List<object>();
		}
	}
}
